package com.lzh.seatrend.util.commonsbeanutils;

import org.apache.commons.beanutils.PropertyUtils;
import org.junit.Test;

public class PropertyUtilsTest {
    @Test
    public void test() throws Exception
    {
        UserInfo userInfo = new UserInfo("lzh", "刘子昊");
        UserInfo copyed = new UserInfo();
        PropertyUtils.copyProperties(copyed,userInfo);
        System.out.println(copyed);
        System.out.println(PropertyUtils.describe(userInfo));
        PropertyUtils.setProperty(userInfo,"userId","gaiminlelzh");
        System.out.println(userInfo);
    }
}
